<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>火电机组冷端优化系统 - 驾驶舱</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
    <style>
        :root {
            --primary-bg: #0f172a;
            --secondary-bg: #1e293b;
            --card-bg: #1a2435;
            --accent: #5eead4;
            --accent-hover: #88f3e2;
            --text-primary: #e2e8f0;
            --text-secondary: #94a3b8;
            --text-tertiary: #64748b;
            --border-color: #334155;
            --success: #4ade80;
            --warning: #fbbf24;
            --error: #f87171;
            --power-color: #f97316;
            --load-color: #38bdf8;
            --pressure-color: #8b5cf6;
            --temp-color: #f43f5e;
            --font-main: 'Segoe UI', 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
            --spacing-sm: 8px;
            --spacing-md: 16px;
            --spacing-lg: 24px;
            --spacing-xl: 32px;
            --radius-sm: 4px;
            --radius-md: 8px;
            --radius-lg: 12px;
        }
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            background: var(--primary-bg);
            color: var(--text-primary);
            font-family: var(--font-main);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }
        
        /* 导航栏容器 */
        .navbar {
            background: var(--secondary-bg);
            border-bottom: 1px solid var(--border-color);
            padding: 0 var(--spacing-lg);
            height: 60px;
            display: flex;
            align-items: center;
            z-index: 100;
        }
        
        /* Logo区域 */
        .logo-area {
            display: flex;
            align-items: center;
            gap: var(--spacing-md);
            padding-right: var(--spacing-lg);
            border-right: 1px solid var(--border-color);
        }
        
        .logo-icon {
            width: 36px;
            height: 36px;
            background: var(--accent);
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--primary-bg);
            font-size: 1rem;
        }
        
        .logo-text {
            font-size: 1.2rem;
            font-weight: 600;
            background: linear-gradient(to right, var(--text-primary), var(--accent));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }
        
        /* 导航区域 */
        .nav-area {
            flex: 1;
            padding: 0 var(--spacing-xl);
            display: flex;
        }
        
        .nav-menu {
            display: flex;
            list-style: none;
            gap: var(--spacing-xl);
        }
        
        .nav-item {
            position: relative;
        }
        
        .nav-link {
            color: var(--text-secondary);
            text-decoration: none;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: var(--spacing-sm);
            padding: var(--spacing-sm) var(--spacing-md);
            border-radius: var(--radius-sm);
            transition: all 0.3s ease;
        }
        
        .nav-link:hover, .nav-link.active {
            color: var(--accent);
            background: rgba(94, 234, 212, 0.1);
        }
        
        .nav-link i {
            font-size: 0.9rem;
        }
        
        /* 下拉菜单 */
        .submenu {
            position: absolute;
            top: 100%;
            left: 0;
            background: var(--secondary-bg);
            border-radius: var(--radius-sm);
            min-width: 180px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
            border: 1px solid var(--border-color);
            z-index: 200;
            display: none;
            padding: var(--spacing-sm) 0;
        }
        
        .nav-item:hover .submenu {
            display: block;
        }
        
        .submenu-item {
            padding: var(--spacing-sm) var(--spacing-md);
        }
        
        .submenu-link {
            color: var(--text-secondary);
            text-decoration: none;
            display: block;
            padding: var(--spacing-sm) var(--spacing-md);
            border-radius: var(--radius-sm);
            transition: all 0.3s ease;
        }
        
        .submenu-link:hover {
            color: var(--accent);
            background: rgba(94, 234, 212, 0.1);
        }
        
        /* 用户区域 */
        .user-area {
            display: flex;
            align-items: center;
            gap: var(--spacing-md);
            position: relative;
        }
        
        .user-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: linear-gradient(45deg, var(--accent), #4a7bff);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 0.9rem;
        }
        
        .user-dropdown {
            position: absolute;
            top: 100%;
            right: 0;
            background: var(--secondary-bg);
            min-width: 200px;
            border-radius: var(--radius-sm);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
            border: 1px solid var(--border-color);
            padding: var(--spacing-md);
            z-index: 200;
            display: none;
        }
        
        .user-dropdown.active {
            display: block;
        }
        
        .user-info {
            padding: var(--spacing-sm) 0 var(--spacing-md);
            border-bottom: 1px solid var(--border-color);
            margin-bottom: var(--spacing-sm);
        }
        
        .user-name {
            font-weight: 600;
            margin-bottom: var(--spacing-xs);
        }
        
        .user-role {
            color: var(--text-secondary);
            font-size: 0.85rem;
        }
        
        .dropdown-item {
            padding: var(--spacing-sm) 0;
        }
        
        .dropdown-link {
            color: var(--text-primary);
            text-decoration: none;
            display: flex;
            align-items: center;
            gap: var(--spacing-sm);
            padding: var(--spacing-sm) var(--spacing-sm);
            border-radius: var(--radius-sm);
            transition: all 0.3s ease;
        }
        
        .dropdown-link:hover {
            background: rgba(94, 234, 212, 0.1);
            color: var(--accent);
        }
        
        /* 内容区域 */
        .content-area {
            flex: 1;
            padding: var(--spacing-xl);
            overflow: auto;
            background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="%231a2435"/><path d="M20,20 L80,20 L80,80 L20,80 Z" stroke="%23334155" fill="none" stroke-width="0.5"/></svg>');
            background-size: 20px 20px;
        }
        
        /* 驾驶舱内容 */
        .dashboard-container {
            max-width: 1600px;
            margin: 0 auto;
            height: 100%;
            display: flex;
            flex-direction: column;
        }
        
        .dashboard-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: var(--spacing-xl);
        }
        
        .page-title {
            font-size: 1.8rem;
            color: var(--text-primary);
            display: flex;
            align-items: center;
            gap: var(--spacing-md);
        }
        
        .time-display {
            font-size: 1.1rem;
            color: var(--text-secondary);
            background: rgba(26, 36, 53, 0.5);
            padding: var(--spacing-sm) var(--spacing-md);
            border-radius: var(--radius-sm);
            border: 1px solid var(--border-color);
        }
        
        /* 关键指标卡片 */
        .key-metrics-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: var(--spacing-md);
            margin-bottom: var(--spacing-xl);
        }
        
        .metric-card {
            background: var(--card-bg);
            border-radius: var(--radius-md);
            padding: var(--spacing-lg);
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
            border: 1px solid var(--border-color);
            position: relative;
            overflow: hidden;
            text-align: center;
        }
        
        .metric-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 4px;
            background: linear-gradient(90deg, var(--accent), transparent);
            opacity: 0.7;
        }
        
        .metric-icon {
            font-size: 1.8rem;
            margin-bottom: var(--spacing-md);
        }
        
        .metric-icon.power {
            color: var(--power-color);
        }
        
        .metric-icon.pressure {
            color: var(--pressure-color);
        }
        
        .metric-icon.fan {
            color: var(--load-color);
        }
        
        .metric-icon.energy {
            color: var(--success);
        }
        
        .metric-icon.alarm {
            color: var(--error);
        }
        
        .metric-card-title {
            font-size: 0.9rem;
            color: var(--text-secondary);
            margin-bottom: var(--spacing-sm);
        }
        
        .metric-card-value {
            font-size: 1.8rem;
            font-weight: 700;
            margin-bottom: var(--spacing-sm);
        }
        
        .metric-card-trend {
            font-size: 0.9rem;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: var(--spacing-sm);
        }
        
        .trend-up {
            color: var(--success);
        }
        
        .trend-down {
            color: var(--error);
        }
        
        /* 图表区域 */
        .charts-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
            gap: var(--spacing-xl);
            margin-bottom: var(--spacing-xl);
        }
        
        .chart-card {
            background: var(--card-bg);
            border-radius: var(--radius-md);
            padding: var(--spacing-lg);
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
            border: 1px solid var(--border-color);
            position: relative;
            overflow: hidden;
        }
        
        .chart-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 4px;
            background: linear-gradient(90deg, var(--accent), transparent);
            opacity: 0.7;
        }
        
        .chart-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: var(--spacing-lg);
        }
        
        .chart-title {
            font-size: 1.2rem;
            font-weight: 600;
            color: var(--accent);
        }
        
        .chart-container {
            height: 300px;
            position: relative;
        }
        
        /* 状态指示器 */
        .status-indicators {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
            gap: var(--spacing-md);
            margin-bottom: var(--spacing-xl);
        }
        
        .status-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
            padding: var(--spacing-md);
            background: rgba(26, 36, 53, 0.3);
            border-radius: var(--radius-sm);
            border: 1px solid var(--border-color);
        }
        
        .status-icon {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: var(--spacing-sm);
            font-size: 1.2rem;
        }
        
        .status-normal {
            background: rgba(94, 234, 212, 0.1);
            color: var(--accent);
        }
        
        .status-warning {
            background: rgba(251, 191, 36, 0.1);
            color: var(--warning);
        }
        
        .status-critical {
            background: rgba(248, 113, 113, 0.1);
            color: var(--error);
        }
        
        .status-label {
            font-size: 0.9rem;
            margin-bottom: var(--spacing-xs);
        }
        
        .status-value {
            font-size: 1.1rem;
            font-weight: 600;
        }
        
        /* 优化建议卡片 */
        .suggestion-card {
            background: var(--card-bg);
            border-radius: var(--radius-md);
            padding: var(--spacing-lg);
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
            border: 1px solid var(--border-color);
            position: relative;
            overflow: hidden;
        }
        
        .suggestion-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 4px;
            background: linear-gradient(90deg, var(--accent), transparent);
            opacity: 0.7;
        }
        
        .suggestion-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: var(--spacing-lg);
        }
        
        .suggestion-title {
            font-size: 1.2rem;
            font-weight: 600;
            color: var(--accent);
        }
        
        .suggestion-list {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: var(--spacing-md);
        }
        
        .suggestion-item {
            background: rgba(26, 36, 53, 0.5);
            border-radius: var(--radius-sm);
            padding: var(--spacing-md);
            border: 1px solid var(--border-color);
        }
        
        .suggestion-item-title {
            font-weight: 500;
            margin-bottom: var(--spacing-sm);
            color: var(--accent);
        }
        
        .suggestion-item-content {
            color: var(--text-secondary);
            font-size: 0.9rem;
        }
        
        /* 页脚 */
        .dashboard-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: var(--spacing-lg) 0;
            border-top: 1px solid var(--border-color);
            color: var(--text-tertiary);
            font-size: 0.9rem;
        }
        
        .system-status {
            display: flex;
            align-items: center;
            gap: var(--spacing-md);
        }
        
        .status-indicator {
            display: flex;
            align-items: center;
            gap: var(--spacing-sm);
        }
        
        .status-dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
        }
        
        .status-normal-dot {
            background: var(--success);
        }
        
        .status-warning-dot {
            background: var(--warning);
        }
        
        .status-critical-dot {
            background: var(--error);
        }
        
        /* 响应式调整 */
        @media (max-width: 1200px) {
            .charts-grid {
                grid-template-columns: 1fr;
            }
        }
        
        @media (max-width: 768px) {
            .navbar {
                flex-direction: column;
                gap: var(--spacing-md);
                padding: var(--spacing-md);
            }
            
            .system-info {
                margin: var(--spacing-md) 0;
                justify-content: center;
                flex-wrap: wrap;
            }
            
            .dashboard-header {
                flex-direction: column;
                align-items: flex-start;
                gap: var(--spacing-md);
            }
            
            .time-display {
                align-self: flex-start;
            }
        }
    </style>
</head>
<body>
    <!-- 导航栏 -->
    <nav class="navbar">
        <!-- Logo区域 -->
        <div class="logo-area">
            <div class="logo-icon">
                <i class="fas fa-bolt"></i>
            </div>
            <div class="logo-text">冷端优化系统</div>
        </div>
        
        <!-- 功能导航区 -->
        <div class="nav-area">
            <ul class="nav-menu">
                <li class="nav-item">
                    <a href="#" class="nav-link active">
                        <i class="fas fa-tachometer-alt"></i> 驾驶舱
                    </a>
                </li>
                
                <li class="nav-item">
                    <a href="#" class="nav-link">
                        <i class="fas fa-cogs"></i> 核心功能
                        <i class="fas fa-chevron-down"></i>
                    </a>
                    <ul class="submenu">
                        <li class="submenu-item">
                            <a href="#" class="submenu-link">
                                <i class="fas fa-tachometer-alt"></i> 背压分析
                            </a>
                        </li>
                        <li class="submenu-item">
                            <a href="#" class="submenu-link">
                                <i class="fas fa-broom"></i> 清洁分析
                            </a>
                        </li>
                        <li class="submenu-item">
                            <a href="#" class="submenu-link">
                                <i class="fas fa-snowflake"></i> 冬季防冻
                            </a>
                        </li>
                    </ul>
                </li>
                
                <li class="nav-item">
                    <a href="#" class="nav-link">
                        <i class="fas fa-brain"></i> AI智能分析
                        <i class="fas fa-chevron-down"></i>
                    </a>
                    <ul class="submenu">
                        <li class="submenu-item">
                            <a href="#" class="submenu-link">
                                <i class="fas fa-comments"></i> 对话式分析
                            </a>
                        </li>
                        <li class="submenu-item">
                            <a href="#" class="submenu-link">
                                <i class="fas fa-search"></i> 检索式分析
                            </a>
                        </li>
                    </ul>
                </li>
                
                <li class="nav-item">
                    <a href="#" class="nav-link">
                        <i class="fas fa-chart-bar"></i> 报表
                    </a>
                </li>
            </ul>
        </div>
        
        <!-- 用户区域 -->
        <div class="user-area">
            <div class="user-avatar" id="userAvatar">
                <i class="fas fa-user"></i>
            </div>
            <div class="user-dropdown" id="userDropdown">
                <div class="user-info">
                    <div class="user-name">管理员</div>
                    <div class="user-role">系统管理员</div>
                </div>
                
                <div class="dropdown-item">
                    <a href="#" class="dropdown-link" id="openChangePassword">
                        <i class="fas fa-key"></i> 修改密码
                    </a>
                </div>
                
                <div class="dropdown-item">
                    <a href="#" class="dropdown-link">
                        <i class="fas fa-user-circle"></i> 个人中心
                    </a>
                </div>
                
                <div class="dropdown-item">
                    <a href="#" class="dropdown-link">
                        <i class="fas fa-sign-out-alt"></i> 退出登录
                    </a>
                </div>
            </div>
        </div>
    </nav>
    
    <!-- 内容区域 - 驾驶舱 -->
    <div class="content-area">
        <div class="dashboard-container">
            <div class="dashboard-header">
                <h1 class="page-title">
                    <i class="fas fa-tachometer-alt"></i> 冷端智慧优化驾驶舱
                </h1>
                <div class="time-display">
                    <i class="fas fa-clock"></i> 
                    <span id="currentTime">2023年10月15日 14:28:36</span>
                </div>
            </div>
            
            <!-- 关键指标区域 -->
            <div class="key-metrics-grid">
                <div class="metric-card">
                    <div class="metric-icon power">
                        <i class="fas fa-bolt"></i>
                    </div>
                    <div class="metric-card-title">发电总量</div>
                    <div class="metric-card-value">635.8 MW</div>
                    <div class="metric-card-trend trend-up">
                        <i class="fas fa-arrow-up"></i>
                        <span>+2.3%</span>
                    </div>
                </div>
                
                <div class="metric-card">
                    <div class="metric-icon pressure">
                        <i class="fas fa-tachometer-alt"></i>
                    </div>
                    <div class="metric-card-title">平均背压</div>
                    <div class="metric-card-value">12.8 kPa</div>
                    <div class="metric-card-trend trend-down">
                        <i class="fas fa-arrow-down"></i>
                        <span>-0.4%</span>
                    </div>
                </div>
                
                <div class="metric-card">
                    <div class="metric-icon fan">
                        <i class="fas fa-fan"></i>
                    </div>
                    <div class="metric-card-title">风机功耗</div>
                    <div class="metric-card-value">85.3 MW</div>
                    <div class="metric-card-trend trend-down">
                        <i class="fas fa-arrow-down"></i>
                        <span>-1.2%</span>
                    </div>
                </div>
                
                <div class="metric-card">
                    <div class="metric-icon energy">
                        <i class="fas fa-leaf"></i>
                    </div>
                    <div class="metric-card-title">月节能总量</div>
                    <div class="metric-card-value">28.7 tce</div>
                    <div class="metric-card-trend trend-up">
                        <i class="fas fa-arrow-up"></i>
                        <span>+3.5%</span>
                    </div>
                </div>
                
                <div class="metric-card">
                    <div class="metric-icon energy">
                        <i class="fas fa-sun"></i>
                    </div>
                    <div class="metric-card-title">日节能总量</div>
                    <div class="metric-card-value">1.2 tce</div>
                    <div class="metric-card-trend trend-up">
                        <i class="fas fa-arrow-up"></i>
                        <span>+0.8%</span>
                    </div>
                </div>
                
                <div class="metric-card">
                    <div class="metric-icon alarm">
                        <i class="fas fa-exclamation-triangle"></i>
                    </div>
                    <div class="metric-card-title">报警数量</div>
                    <div class="metric-card-value">3</div>
                    <div class="metric-card-trend trend-down">
                        <i class="fas fa-arrow-down"></i>
                        <span>-1</span>
                    </div>
                </div>
            </div>
            
            <!-- 图表区域 -->
            <div class="charts-grid">
                <!-- 发电负荷趋势 -->
                <div class="chart-card">
                    <div class="chart-header">
                        <h2 class="chart-title">发电负荷趋势</h2>
                    </div>
                    <div class="chart-container">
                        <canvas id="powerLoadChart"></canvas>
                    </div>
                </div>
                
                <!-- 风机功耗趋势 -->
                <div class="chart-card">
                    <div class="chart-header">
                        <h2 class="chart-title">风机功耗趋势</h2>
                    </div>
                    <div class="chart-container">
                        <canvas id="fanPowerChart"></canvas>
                    </div>
                </div>
                
                <!-- 背压趋势 -->
                <div class="chart-card">
                    <div class="chart-header">
                        <h2 class="chart-title">背压趋势</h2>
                    </div>
                    <div class="chart-container">
                        <canvas id="pressureTrendChart"></canvas>
                    </div>
                </div>
                
                <!-- 温度趋势 -->
                <div class="chart-card">
                    <div class="chart-header">
                        <h2 class="chart-title">温度趋势</h2>
                    </div>
                    <div class="chart-container">
                        <canvas id="temperatureChart"></canvas>
                    </div>
                </div>
            </div>
            
            <!-- 状态指示器 -->
            <div class="status-indicators">
                <div class="status-item">
                    <div class="status-icon status-normal">
                        <i class="fas fa-check-circle"></i>
                    </div>
                    <div class="status-label">冷却水流量</div>
                    <div class="status-value">正常</div>
                </div>
                
                <div class="status-item">
                    <div class="status-icon status-normal">
                        <i class="fas fa-check-circle"></i>
                    </div>
                    <div class="status-label">真空度</div>
                    <div class="status-value">正常</div>
                </div>
                
                <div class="status-item">
                    <div class="status-icon status-warning">
                        <i class="fas fa-exclamation-triangle"></i>
                    </div>
                    <div class="status-label">凝汽器清洁</div>
                    <div class="status-value">需关注</div>
                </div>
                
                <div class="status-item">
                    <div class="status-icon status-normal">
                        <i class="fas fa-check-circle"></i>
                    </div>
                    <div class="status-label">循环水泵</div>
                    <div class="status-value">正常</div>
                </div>
            </div>
            
            <!-- 优化建议 -->
            <div class="suggestion-card">
                <div class="suggestion-header">
                    <h2 class="suggestion-title">优化建议</h2>
                </div>
                <div class="suggestion-list">
                    <div class="suggestion-item">
                        <div class="suggestion-item-title">循环水流量优化</div>
                        <div class="suggestion-item-content">当前流量12,500 m³/h，建议增加5%流量以提高效率</div>
                    </div>
                    
                    <div class="suggestion-item">
                        <div class="suggestion-item-title">凝汽器真空优化</div>
                        <div class="suggestion-item-content">当前真空度-95.2 kPa，建议检查密封性</div>
                    </div>
                    
                    <div class="suggestion-item">
                        <div class="suggestion-item-title">冷却塔效率提升</div>
                        <div class="suggestion-item-content">当前效率78.3%，建议清洁填料以提高效率</div>
                    </div>
                    
                    <div class="suggestion-item">
                        <div class="suggestion-item-title">端差优化</div>
                        <div class="suggestion-item-content">当前端差5.8°C，建议优化清洗周期</div>
                    </div>
                </div>
            </div>
            
            <div class="dashboard-footer">
                <div class="system-status">
                    <div class="status-indicator">
                        <div class="status-dot status-normal-dot"></div>
                        <span>系统运行正常</span>
                    </div>
                    <div class="status-indicator">
                        <div class="status-dot status-warning-dot"></div>
                        <span>1项需关注</span>
                    </div>
                    <div class="status-indicator">
                        <div class="status-dot status-critical-dot"></div>
                        <span>0项严重告警</span>
                    </div>
                </div>
                
                <div class="data-update">
                    最后更新: <span id="lastUpdateTime">14:28:30</span>
                </div>
            </div>
        </div>
    </div>
    
    <!-- 修改密码模态框 -->
    <div class="modal" id="passwordModal">
        <div class="modal-content">
            <div class="modal-header">
                <h3 class="modal-title">
                    <i class="fas fa-key"></i> 修改密码
                </h3>
            </div>
            
            <div class="modal-body">
                <form id="passwordForm">
                    <div class="form-group">
                        <label for="currentPassword" class="form-label">当前密码</label>
                        <input type="password" id="currentPassword" class="form-input" required>
                    </div>
                    
                    <div class="form-group">
                        <label for="newPassword" class="form-label">新密码</label>
                        <input type="password" id="newPassword" class="form-input" required>
                    </div>
                    
                    <div class="form-group">
                        <label for="confirmPassword" class="form-label">确认新密码</label>
                        <input type="password" id="confirmPassword" class="form-input" required>
                    </div>
                </form>
            </div>
            
            <div class="modal-footer">
                <button class="btn btn-secondary" id="cancelChangePassword">
                    取消
                </button>
                <button class="btn btn-primary" id="submitChangePassword">
                    保存更改
                </button>
            </div>
        </div>
    </div>
    
    <script>
        // 页面加载完成后执行
        document.addEventListener('DOMContentLoaded', function() {
            // 用户头像下拉菜单交互
            const userAvatar = document.getElementById('userAvatar');
            const userDropdown = document.getElementById('userDropdown');
            const passwordModal = document.getElementById('passwordModal');
            const openChangePassword = document.getElementById('openChangePassword');
            const cancelChangePassword = document.getElementById('cancelChangePassword');
            
            // 切换用户下拉菜单
            userAvatar.addEventListener('click', function(e) {
                e.stopPropagation();
                userDropdown.classList.toggle('active');
            });
            
            // 点击其他地方关闭下拉菜单
            document.addEventListener('click', function(e) {
                if (!userDropdown.contains(e.target) && e.target !== userAvatar) {
                    userDropdown.classList.remove('active');
                }
            });
            
            // 打开修改密码模态框
            openChangePassword.addEventListener('click', function(e) {
                e.preventDefault();
                userDropdown.classList.remove('active');
                passwordModal.classList.add('active');
            });
            
            // 关闭模态框
            cancelChangePassword.addEventListener('click', function() {
                passwordModal.classList.remove('active');
            });
            
            // 提交密码修改
            document.getElementById('submitChangePassword').addEventListener('click', function() {
                const currentPassword = document.getElementById('currentPassword').value;
                const newPassword = document.getElementById('newPassword').value;
                const confirmPassword = document.getElementById('confirmPassword').value;
                
                if (newPassword !== confirmPassword) {
                    alert('新密码和确认密码不一致！');
                    return;
                }
                
                if (newPassword.length < 6) {
                    alert('密码长度至少为6位！');
                    return;
                }
                
                // 在实际项目中这里会有API调用
                console.log('修改密码:', {
                    currentPassword,
                    newPassword
                });
                
                alert('密码已成功更新！');
                passwordModal.classList.remove('active');
                
                // 清空表单
                document.getElementById('currentPassword').value = '';
                document.getElementById('newPassword').value = '';
                document.getElementById('confirmPassword').value = '';
            });
            
            // 点击模态框背景关闭模态框
            passwordModal.addEventListener('click', function(e) {
                if (e.target === passwordModal) {
                    passwordModal.classList.remove('active');
                }
            });
            
            // 防止模态框内容点击关闭
            document.querySelector('.modal-content').addEventListener('click', function(e) {
                e.stopPropagation();
            });
            
            // 更新时间显示
            function updateTime() {
                const now = new Date();
                const dateStr = now.toLocaleDateString('zh-CN', {
                    year: 'numeric',
                    month: 'long',
                    day: 'numeric'
                });
                const timeStr = now.toLocaleTimeString('zh-CN');
                
                document.getElementById('currentTime').textContent = `${dateStr} ${timeStr}`;
                
                // 每分钟更新一次数据时间
                if (now.getSeconds() === 0) {
                    document.getElementById('lastUpdateTime').textContent = timeStr;
                }
            }
            
            // 初始更新时间
            updateTime();
            
            // 每秒更新一次时间
            setInterval(updateTime, 1000);
            
            // 初始化图表
            function initCharts() {
                // 发电负荷趋势图表
                const powerLoadCtx = document.getElementById('powerLoadChart').getContext('2d');
                new Chart(powerLoadCtx, {
                    type: 'line',
                    data: {
                        labels: ['09:00', '10:00', '11:00', '12:00', '13:00', '14:00'],
                        datasets: [{
                            label: '发电量 (MW)',
                            data: [580, 610, 625, 630, 635, 640],
                            borderColor: 'rgba(249, 115, 22, 1)',
                            backgroundColor: 'rgba(249, 115, 22, 0.1)',
                            borderWidth: 2,
                            tension: 0.3,
                            fill: true
                        }, {
                            label: '负荷率 (%)',
                            data: [82, 85, 87, 88, 87, 87.5],
                            borderColor: 'rgba(56, 189, 248, 1)',
                            backgroundColor: 'rgba(56, 189, 248, 0.1)',
                            borderWidth: 2,
                            tension: 0.3,
                            fill: true
                        }]
                    },
                    options: {
                        responsive: true,
                        maintainAspectRatio: false,
                        scales: {
                            y: {
                                grid: {
                                    color: 'rgba(255, 255, 255, 0.1)'
                                },
                                ticks: {
                                    color: 'rgba(148, 163, 184, 0.8)'
                                }
                            },
                            x: {
                                grid: {
                                    color: 'rgba(255, 255, 255, 0.1)'
                                },
                                ticks: {
                                    color: 'rgba(148, 163, 184, 0.8)'
                                }
                            }
                        },
                        plugins: {
                            legend: {
                                labels: {
                                    color: 'rgba(148, 163, 184, 0.8)'
                                }
                            }
                        }
                    }
                });
                
                // 风机功耗趋势图表
                const fanPowerCtx = document.getElementById('fanPowerChart').getContext('2d');
                new Chart(fanPowerCtx, {
                    type: 'line',
                    data: {
                        labels: ['09:00', '10:00', '11:00', '12:00', '13:00', '14:00'],
                        datasets: [{
                            label: '风机功耗 (MW)',
                            data: [88, 87, 86, 85.5, 85.8, 85.3],
                            borderColor: 'rgba(56, 189, 248, 1)',
                            backgroundColor: 'rgba(56, 189, 248, 0.1)',
                            borderWidth: 2,
                            tension: 0.3,
                            fill: true
                        }]
                    },
                    options: {
                        responsive: true,
                        maintainAspectRatio: false,
                        scales: {
                            y: {
                                grid: {
                                    color: 'rgba(255, 255, 255, 0.1)'
                                },
                                ticks: {
                                    color: 'rgba(148, 163, 184, 0.8)'
                                }
                            },
                            x: {
                                grid: {
                                    color: 'rgba(255, 255, 255, 0.1)'
                                },
                                ticks: {
                                    color: 'rgba(148, 163, 184, 0.8)'
                                }
                            }
                        },
                        plugins: {
                            legend: {
                                labels: {
                                    color: 'rgba(148, 163, 184, 0.8)'
                                }
                            }
                        }
                    }
                });
                
                // 背压趋势图表
                const pressureTrendCtx = document.getElementById('pressureTrendChart').getContext('2d');
                new Chart(pressureTrendCtx, {
                    type: 'line',
                    data: {
                        labels: ['09:00', '10:00', '11:00', '12:00', '13:00', '14:00'],
                        datasets: [{
                            label: '平均背压 (kPa)',
                            data: [13.2, 13.0, 12.9, 12.8, 12.85, 12.8],
                            borderColor: 'rgba(139, 92, 246, 1)',
                            backgroundColor: 'rgba(139, 92, 246, 0.1)',
                            borderWidth: 2,
                            tension: 0.3,
                            fill: true
                        }]
                    },
                    options: {
                        responsive: true,
                        maintainAspectRatio: false,
                        scales: {
                            y: {
                                grid: {
                                    color: 'rgba(255, 255, 255, 0.1)'
                                },
                                ticks: {
                                    color: 'rgba(148, 163, 184, 0.8)'
                                }
                            },
                            x: {
                                grid: {
                                    color: 'rgba(255, 255, 255, 0.1)'
                                },
                                ticks: {
                                    color: 'rgba(148, 163, 184, 0.8)'
                                }
                            }
                        },
                        plugins: {
                            legend: {
                                labels: {
                                    color: 'rgba(148, 163, 184, 0.8)'
                                }
                            }
                        }
                    }
                });
                
                // 温度趋势图表
                const temperatureCtx = document.getElementById('temperatureChart').getContext('2d');
                new Chart(temperatureCtx, {
                    type: 'line',
                    data: {
                        labels: ['09:00', '10:00', '11:00', '12:00', '13:00', '14:00'],
                        datasets: [{
                            label: '冷却水温度 (°C)',
                            data: [86.4, 86.2, 85.8, 85.5, 85.2, 85.0],
                            borderColor: 'rgba(244, 63, 94, 1)',
                            backgroundColor: 'rgba(244, 63, 94, 0.1)',
                            borderWidth: 2,
                            tension: 0.3,
                            fill: true
                        }]
                    },
                    options: {
                        responsive: true,
                        maintainAspectRatio: false,
                        scales: {
                            y: {
                                grid: {
                                    color: 'rgba(255, 255, 255, 0.1)'
                                },
                                ticks: {
                                    color: 'rgba(148, 163, 184, 0.8)'
                                }
                            },
                            x: {
                                grid: {
                                    color: 'rgba(255, 255, 255, 0.1)'
                                },
                                ticks: {
                                    color: 'rgba(148, 163, 184, 0.8)'
                                }
                            }
                        },
                        plugins: {
                            legend: {
                                labels: {
                                    color: 'rgba(148, 163, 184, 0.8)'
                                }
                            }
                        }
                    }
                });
            }
            
            initCharts();
            
            // 模拟实时数据更新
            function updateMetrics() {
                const metrics = document.querySelectorAll('.metric-card-value');
                
                metrics.forEach(metric => {
                    const currentValue = parseFloat(metric.textContent);
                    const randomChange = (Math.random() - 0.5) * 0.5;
                    const newValue = currentValue + randomChange;
                    
                    // 更新数值
                    metric.textContent = newValue.toFixed(metric.classList.contains('power') ? 0 : 1);
                    
                    // 更新趋势指示
                    const trend = metric.parentElement.querySelector('.metric-card-trend');
                    if (trend) {
                        trend.classList.remove('trend-up', 'trend-down');
                        
                        if (randomChange > 0) {
                            trend.classList.add('trend-up');
                            trend.innerHTML = `<i class="fas fa-arrow-up"></i> <span>+${Math.abs(randomChange).toFixed(1)}%</span>`;
                        } else if (randomChange < 0) {
                            trend.classList.add('trend-down');
                            trend.innerHTML = `<i class="fas fa-arrow-down"></i> <span>-${Math.abs(randomChange).toFixed(1)}%</span>`;
                        }
                    }
                });
            }
            
            // 每5秒更新一次指标
            setInterval(updateMetrics, 5000);
        });
    </script>
</body>
</html>